Skip to content

[Autoloop: python-to-go-migration]#39

Merged
mrjf merged 7 commits into
mainfrom
autoloop/python-to-go-migration
May 14, 2026
Merged

[Autoloop: python-to-go-migration]#39
mrjf merged 7 commits into
mainfrom
autoloop/python-to-go-migration

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.

Python-to-Go Migration

Goal: Incrementally rewrite the APM CLI from Python to Go, one module at a time.

Program Issue: #3

Current Best Metric: 16.68% Python lines migrated


Iteration 32 (latest)

Migrated 16 modules (+4024 Python lines):

Install phases:

  • install/plan.py (425) — UpdatePlan diff, RenderPlanText, LockfileSatisfiesManifest
  • install/insecure_policy.py (229) — HTTP dep policy helpers
  • install/phases/cleanup.py (158) — orphan + stale-file cleanup
  • install/phases/finalize.py (92) — verbose stats + install result
  • install/phases/heal.py (90) — heal-chain dispatcher
  • install/phases/lockfile.py (260) — LockfileBuilder, compute deployed hashes
  • install/phases/post_deps_local.py (117) — local content stale cleanup
  • install/phases/download.py (135) — parallel pre-download

MCP modules:

  • install/mcp/warnings.py (123) — F5 SSRF + F7 shell metachar warnings
  • install/mcp/conflicts.py (122) — E1-E15 flag conflict matrix
  • install/mcp/entry.py (106) — pure MCP entry builder
  • install/mcp/writer.py (132) — apm.yml MCP persistence
  • install/mcp/command.py (160) — MCP install orchestrator
  • install/mcp/registry.py (277) — registry URL validation

Policy checks:

  • policy/policy_checks.py (1010) — allowlist, denylist, required packages
  • policy/ci_checks.py (588) — baseline CI checks (lockfile-exists, sync, drift)

All modules use stdlib-only Go. go build ./... and go test ./... pass.

Generated by Autoloop · ● 59.6M ·

github-actions Bot and others added 4 commits May 13, 2026 16:40
…o Go (+3691 Python lines, 11.07%)

Rebuild 30 modules from iter-24 baseline and add 5 new modules:
- compilation: buildid, constants, output_writer, constitution (iter-24 rebuild)
- compilation: claude_formatter, gemini_formatter (agentformatter), injector, template_builder (new)
- models: results, dependency/types
- policy: schema, matcher, inheritance
- install: request, summary, mcp/args
- runtime: base
- marketplace: validator, errors, semver, tag_pattern, shadow_detector
- cache: url_normalize, paths, integrity
- integration: utils, coverage
- workflow: parser (iter-24 rebuild), discovery (new)
- core: null_logger, docker_args
- deps: git_remote_ops, aggregator, installed_package
- primitives: models

New metric: 11.07% (7936/71696 Python lines migrated)
Previous best: 9.89%
Delta: +1.18%

Run: https://github.com/githubnext/apm/actions/runs/25812073376

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…+4024 Python lines)

Migrated install/plan.py, insecure_policy.py, 6 install phases (cleanup,
finalize, heal, lockfile, post_deps_local, download), 6 MCP modules
(warnings, conflicts, entry, writer, command, registry), and 2 policy
check modules (policy_checks, ci_checks). All use stdlib-only Go.
go build ./... and go test ./... pass. Metric: 16.68% (prev 15.16, +1.52).

Run: https://github.com/githubnext/apm/actions/runs/25835089265

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…1103 Python lines)

Migrated modules:
- integration/skill_transformer.py (113) -> skilltransformer: ToHyphenCase, SkillTransformer.TransformToAgent
- integration/dispatch.py (91) -> dispatch: PrimitiveDispatch struct, DefaultDispatchTable
- install/heals/base.py (122) -> heals: HealContext, Heal interface, RunHealChain
- install/heals/branch_ref_drift.py (66) -> heals: BranchRefDriftHeal
- install/heals/buggy_lockfile_recovery.py (99) -> heals: BuggyLockfileRecoveryHeal
- compilation/constitution_block.py (104) -> constitutionblock: RenderBlock, InjectOrUpdate
- install/phases/local_content.py (191) -> localcontent: ProjectHasRootPrimitives, HasLocalApmContent
- install/phases/policy_target_check.py (113) -> policytargetcheck: TargetCheckIDs, ShouldRunCheck
- install/phases/policy_gate.py (204) -> policygate: PolicyViolationError, EnforcementResult

Metric: 16.68 -> 18.22 (+1.54)
Run: https://github.com/githubnext/apm/actions/runs/25836695236

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 1c70c74

Generated by Autoloop

@github-actions github-actions Bot mentioned this pull request May 14, 2026
@mrjf mrjf marked this pull request as ready for review May 14, 2026 02:44
…dels, coworkpaths, mcpdep, sharedclonecache

Run: https://github.com/githubnext/apm/actions/runs/25838675792

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: f0e57d6

Generated by Autoloop

…926 lines)

Migrated modules:
- policy/models.py (143): CheckResult/CIAuditResult + SARIF serialisation
- models/plugin.py (152): PluginMetadata/Plugin structs + file discovery
- deps/dependency_graph.py (227): DependencyNode/Tree/Graph data structures
- core/apm_yml.py (107): targets/target field parser with CSV/list sugar
- integration/cleanup.py (297): stale deployed-file removal with 3 safety gates

Metric: 19.79 -> 21.08 (+1.29)
Run: https://github.com/githubnext/apm/actions/runs/25842273066

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: bceb743

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author

🤖 Iteration 35✅ Accepted

  • Change: Migrated 5 modules: policy/models (143), models/plugin (152), deps/dependency_graph (227), core/apm_yml (107), integration/cleanup (297) = +926 Python lines
  • Metric: 21.08% (best: 19.79%, delta: +1.29%)
  • Commit: f0e57d6
  • Result: All 5 modules use stdlib-only Go. policymodels includes full SARIF serialisation; depgraph provides DependencyNode/Tree/Graph; cleanuphelper implements all 3 safety gates (path validation, dir rejection, provenance hash check).

Generated by Autoloop · ● 63M ·

@mrjf mrjf merged commit 0e9a816 into main May 14, 2026
github-actions Bot added a commit that referenced this pull request May 14, 2026
- Update latest status: iteration 35, 21.08% migrated (15,116/71,696 lines)
- Update PR reference from #17 to #39 (merged 2026-05-14)
- Expand migration progress table with iterations 28-35
- Update migrated modules table to all 89 modules from migration-status.json
- Remove stale branch-reset caveat (JSON is now current)
- Update Go build/test validation notes to reflect iters 32-35
- Update Next up section from memory/autoloop Future Directions
- Update Last updated timestamp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: e415d93

Generated by Autoloop

@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 0564ba9

Generated by Autoloop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant